﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace LINQLambda
{
    public static class StringBuilderExtension
    {
        public static StringBuilder Substring(this StringBuilder str, int index, int length)
        {
            StringBuilder result = new StringBuilder("");
            for (int i = index; i < index + length; i++)
            {
                result.Append(str[i]);
            }
            return result;
        }
    }

    public static class StringExtension
    {
        public static String CapitaliseFirstLetterInWords(this String str)
        {
            return CultureInfo.CurrentCulture.TextInfo.ToTitleCase(str);
        }
    }
}
